package cn.njupt.gis.gml;

import java.io.InputStream;

import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;

import cn.njupt.gis.geo.FeatureCollection;

public class GmlParser {
	public static FeatureCollection parse(InputStream in) 
	{
		FeatureCollection features = null;
		try {
			features = new FeatureCollection();
			SAXParserFactory saxparserfactory = SAXParserFactory.newInstance();
			SAXParser parser = saxparserfactory.newSAXParser();
			 GmlHandler handler = new GmlHandler(features);
			 parser.parse(in, handler);
			 
		} catch (Exception e) {
			e.printStackTrace();
		}
		return features;
	}
}
